laravel factory pass parameter

34

//In your case you don't even need to access those attributes, since they'll automatically be merged in:

$business = factory(App\Business::class)->create();

factory(App\User::class, 5)->create([
    'business_id' => $business->id,
]);

Comments

Submit
0 Comments